Visual tests store snapshots of your app’s appearance and compare them to the current state of your app. This is an extensive article that explains what visual tests are and when they should be used. It is suitable for beginners to visual tests and Playwright, and it has some tips for using different types (page vs element) of visual tests for different scenarios and integrating visual tests in your CI/CD pipeline efficiently.
Friday, March 8, 2024Flaky tests are when tests sometimes pass and sometimes don't. Most of the time, they occur due to tests being poorly written and not hermetic. Sometimes, they can be due to resource constraints or data conflicts in the test environment. To prevent flaky tests, developers should catch them early by running tests often and reduce dependencies on external factors as much as possible.
Mocking in tests, particularly for IO operations, can lead to a false sense of security as it often fails to cover edge cases and failure modes of the real service. Instead of relying on mocks, developers should prioritize thorough unit testing and use alternatives like in-memory databases or virtual file systems for simpler IO testing.
Uber developed Testopedia to manage its large suite of tests. It's used to track test statistics and categorize tests based on their stability. Testopedia uses a bucketing algorithm to handle test queries and uses a sliding window algorithm to identify flaky tests.